unit vector;
interface
uses Stl_types, stl_base;
Type v_iterator = Iterator;
Type Tvector = class(Container)
private
  _Ibegin, _Iend: v_Iterator;
public
  procedure push_back(el: StlType);
  procedure push_front(el:StlType);
  function top: StlType;
  procedure pop_back;
  procedure pop_front;
end;

implementation

procedure Tvector.push_back( el:StlType);
var
  elem: Iterator;
begin
   //new(elem);
   insert(el, size + 1);
end;

procedure Tvector.push_front( el:StlType);
var
  elem:Iterator;
begin
  new(elem);
  elem^.data := el;
  elem^.prev := _IBEGIN;
  elem^.next := _IBEGIN^.next;
  _IBEGIN^.next^.prev := elem;
  _IBEGIN^.next := elem;
end;

function Tvector.top:StlType;
begin
  top := _IBEGIN^.next^.data;
end;

procedure Tvector.pop_back;
begin
  if (not Empty) then
  delete(_IEND^.prev);
end;

procedure Tvector.pop_front;
begin
  if (not Empty) then
  delete(_IBEGIN^.next);
end;


end.
